﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace Collector
{
    public partial class ProFrm : Form
    {
        public bool TestState { get; set; }
        public string msgInfo = "";
        public ProFrm(string Info)
        {
            InitializeComponent();
            this.TestState = false;
            this.Shown += Frm_Shown;
            msgInfo = Info;
        }
        void Frm_Shown(object sender, EventArgs e)
        {
            btnretry.Focus();
            this.ShowMsg(msgInfo, Color.Blue);
        }

        private void ShowMsg(string msg, Color _clr)
        {
            this.lbMsg.Invoke(new EventHandler(delegate
            {
                this.lbMsg.ForeColor = _clr;
                this.lbMsg.Text = msg;
            }));
        }
        private void btnfail_Click(object sender, EventArgs e)
        {
            this.TestState = false;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
        private void btnretry_Click(object sender, EventArgs e)
        {
            this.TestState = true;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
    }
}